package chapter4.xml;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.FileSystemResource;

public class Test {
	public static void main(String[] args) {
		DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
		XmlBeanDefinitionReader rdr = new XmlBeanDefinitionReader(factory);
		rdr.loadBeanDefinitions(new FileSystemResource(
				"resource/chapter4/xmlHelloWord.xml"));
		MessageProvider provider = (MessageProvider) factory
				.getBean("messageProvider");
		MessageRenderer renderer = (MessageRenderer) factory
				.getBean("messageRender");
		renderer.setMessageProvider(provider);
		renderer.render();
	}
}
